package com.tianji.learning.controller;


import com.tianji.learning.domain.vo.SignResultVO;
import com.tianji.learning.service.ISignRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 签到记录表 前端控制器
 * </p>
 *
 * @author xzh
 * @since 2024-03-18
 */
@RestController
@RequestMapping("/sign-records")
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
@Api(tags = "签到相关接口")
public class SignRecordController {

    private final ISignRecordService recordService;

    /**
     * 签到功能接口
     * @return
     */
    @PostMapping
    @ApiOperation(value = "签到功能接口")
    public SignResultVO addSignRecords(){
        return recordService.addSignRecords();
    }

    /**
     * 获得每天的登录情况
     * @return
     */
    @GetMapping
    @ApiOperation(value = "获得每天的登录情况")
    public List<Long> getSignRecords(){
        return recordService.getSignRecords();
    }

}
